import { Routes } from "@angular/router";
import { DoubleDataBindingComponent } from "./double-data-binding/double-data-binding.component";
import { TplOutletParentComponent } from "./tpl-outlet/tpl-outlet-parent.component";
import { SunshineNgContentParentComponent } from "../angular-base/sunshine-ng-content/sunshine-ng-content-parent.component";
import { SunshineLifecycleComponent } from "./sunshine-lifecycle/sunshine-lifecycle.component";
import { AlertBoxComponent } from "../angular-base/sunshine-dynamic/alert-box/alert-box.component";
import { CommentDetailComponent } from "./comment/comment-detail/comment-detail.component";
import { CommentListComponent } from "./comment/comment-list/comment-list.component";
import { authGuard2, canAdmin } from "./AuthGuard/AuthGuard";
import { LoginComponent } from "./auth/login/login.component";
import { CommentAddComponent } from "./comment/comment-add/comment-add.component";
// 学习模块
export const studyRoutes: Routes = [
  { path: "login", component: LoginComponent },
  { path: "", component: LoginComponent },
  { path: "doubleDataBinding", component: DoubleDataBindingComponent },
  { path: 'tpl-outlet-parent', component: TplOutletParentComponent },
  { path: 'sunshine-ng-content-parent', component: SunshineNgContentParentComponent },
  { path: 'sunshine-lifecycle', component: SunshineLifecycleComponent },
  { path: 'alert-box', component: AlertBoxComponent },//动态组件
  { path: 'comment-detail/:id', component: CommentDetailComponent, canActivate: [canAdmin] },//动态组件
  { path: 'comment-detail2', component: CommentDetailComponent },     //动态组件
  {
    path: 'comment-list', component: CommentListComponent, canActivate: [
      authGuard2
      // AuthGuard
    ]
  },//动态组件
  { path: "comment-add", component: CommentAddComponent }
];
